<template>
    <div class="deviceStatistics">
        <div class="boxTitle">
            <img src="@/assets/images/home/rightIcon.png" alt="">
            <span class="title">设备统计</span>
        </div>
        <div class="deviceNum">
            <div class="deviceNum_item">
                <div class="num_title">设备总数</div>
                <div class="num_line"></div>
                <div class="num_text">129</div>
            </div>
            <div class="deviceNum_item">
                <div class="num_title">设备总数</div>
                <div class="num_line"></div>
                <div class="num_text">129</div>
            </div>
            <div class="deviceNum_item">
                <div class="num_title">设备总数</div>
                <div class="num_line"></div>
                <div class="num_text">129</div>
            </div>
        </div>
        <div class="deviceStatus">
            <div class="status_item status_yx">
                <span class="status_num">118</span>
                <span class="status_text">运行</span>
            </div>
            <div class="status_item status_lx">
                <span class="status_num">6</span>
                <span class="status_text">离线</span>
            </div>
            <div class="status_item status_gz">
                <span class="status_num">12</span>
                <span class="status_text">故障</span>
            </div>
            <div class="status_item status_bj">
                <span class="status_num">9</span>
                <span class="status_text">报警</span>
            </div>
        </div>
        <div class="longRange">
            <div class="longRange_title">
                <div class="title_status"></div>
                <div class="title_text">非远程设备占比</div>
            </div>
            <div class="longRange_content">
                <div class="longRange_item">
                    <div class="longRange_head">一级配电箱</div>
                    <pieChart :data="chartData.data"></pieChart>
                </div>
                <div class="longRange_item">
                    <div class="longRange_head">二级配电箱</div>
                    <pieChart :data="chartData.data"></pieChart>
                </div>
                <div class="longRange_item">
                    <div class="longRange_head">变配电设备</div>
                    <pieChart :data="chartData.data"></pieChart>
                </div>
                <div class="longRange_item">
                    <div class="longRange_head">其它</div>
                    <pieChart :data="chartData.data"></pieChart>
                </div>
            </div>
            <div class="statusBox">
                <div class="statusBox_item item_zs">
                    <div class="item_status"></div>
                    <div class="item_text">总数</div>
                    <div class="item_num">25</div>
                </div>
                <div class="statusBox_item item_yx">
                    <div class="item_status"></div>
                    <div class="item_text">总数</div>
                    <div class="item_num">25</div>
                </div>
                <div class="statusBox_item item_tz">
                    <div class="item_status"></div>
                    <div class="item_text">总数</div>
                    <div class="item_num">25</div>
                </div>
                <div class="statusBox_item item_gz">
                    <div class="item_status"></div>
                    <div class="item_text">总数</div>
                    <div class="item_num">25</div>
                </div>
                <div class="statusBox_item item_lx">
                    <div class="item_status"></div>
                    <div class="item_text">总数</div>
                    <div class="item_num">25</div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import pieChart from "./pieChart.vue";

let chartData = reactive({
    data: [
        { value: '38', name: '已完成' },
        { value: "82", name: '未完成' },
    ],
})
</script>

<style lang="scss" scoped>
.deviceStatistics {
    position: absolute;
    z-index: 999;
    background: url(@/assets/images/monitoring/left-01.png) no-repeat;
    background-size: 100% 100%;
    left: vh(20);
    top: vh(61);
    width: vh(421);
    height: vh(352);
    font-size: vh(14);
    color: #FFFFFF;

    .deviceNum {
        display: flex;
        justify-content: space-between;
        padding: 0 vh(14) 0 vh(15);

        .deviceNum_item {
            width: vh(120);
            height: vh(63);
            padding: vh(8) vh(15) 0 vh(8);
            background: rgba(0, 127, 174, 0.2);
            border-radius: vh(4);

            .num_title {
                font-family: Source Han Sans CN;
                font-weight: 400;
                font-size: vh(14);
                color: #00E3FF;
                line-height: 1;
                margin-bottom: vh(6);
            }

            .num_line {
                width: vh(23);
                height: vh(2);
                background: #00E3FF;
            }

            .num_text {
                font-family: Arial;
                font-weight: bold;
                font-size: vh(20);
                color: #FFFFFF;
                line-height: 1;
                margin-top: vh(6);
                text-align: right;
            }
        }
    }

    .deviceStatus {
        display: flex;
        justify-content: space-between;
        padding: 0 vh(14) 0 vh(15);
        margin-top: vh(10);

        .status_item {
            width: vh(89);
            height: vh(59);
            padding-top: vh(13);
            display: flex;
            flex-direction: column;
            align-items: center;

            &.status_yx {
                background: url(@/assets/images/monitoring/ynxbg.png) no-repeat;
                background-size: 100%;
            }

            &.status_lx {
                background: url(@/assets/images/monitoring/lx.png) no-repeat;
                background-size: 100%;
            }

            &.status_gz {
                background: url(@/assets/images/monitoring/gz.png) no-repeat;
                background-size: 100%;
            }

            &.status_bj {
                background: url(@/assets/images/monitoring/bj.png) no-repeat;
                background-size: 100%;
            }

            .status_num {
                font-family: DIN;
                font-weight: bold;
                font-size: vh(18);
                color: #CFA972;
                line-height: 1;
            }

            .status_text {
                font-family: Source Han Sans CN;
                font-weight: 400;
                font-size: vh(12);
                color: #E8E8E8;
                margin-top: vh(6);
                line-height: 1;
            }
        }
    }

    .longRange {
        padding: vh(11) vh(14) 0 vh(15);

        .longRange_title {
            display: flex;
            align-items: center;

            .title_status {
                width: vh(3);
                height: vh(11);
                background: #00E3FF;
                border-radius: vh(2);
                margin-right: vh(6);
            }

            .title_text {
                font-family: Source Han Sans CN;
                font-weight: 500;
                font-size: vh(12);
                color: #00E3FF;
                line-height: 1;
            }
        }

        .longRange_content {
            display: flex;
            padding: vh(9) vh(10) 0 vh(8);
            justify-content: space-between;
            align-items: center;

            .longRange_item {
                width: vh(71);
                display: flex;
                flex-direction: column;

                .longRange_head {
                    width: vh(71);
                    height: vh(17);
                    background: rgba(255, 255, 255, 0.2);
                    border-radius: vh(2);
                    margin-bottom: vh(13);
                    font-family: Source Han Sans CN;
                    font-weight: 400;
                    font-size: vh(12);
                    color: #FFFFFF;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }
            }
        }

        .statusBox {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 vh(15);
            width: 100%;
            height: vh(39);
            background: rgba(0, 127, 174, 0.2);
            border-radius: vh(3);
            margin-top: vh(14);

            .statusBox_item {
                display: flex;
                align-items: center;

                .item_status {
                    width: vh(6);
                    height: vh(6);
                    border-radius: 50%;
                }

                .item_text {
                    font-family: Source Han Sans CN;
                    font-weight: 500;
                    font-size: vh(12);
                    color: #FFFFFF;
                    margin-right: vh(8);
                    margin-left: vh(5);
                    line-height: 1;
                }

                .item_num {
                    font-family: Arial;
                    font-weight: bold;
                    font-size: vh(16);
                    line-height: 1;
                }

                &.item_zs {
                    .item_status {
                        background: #00E3FF;
                    }
                    .item_num {
                        color: #00E3FF;
                    }
                }

                &.item_yx {
                    .item_status {
                        background: #00E15F;
                    }
                    .item_num {
                        color: #00E15F;
                    }
                }

                &.item_tz {
                    .item_status {
                        background: #D7A865;
                    }
                    .item_num {
                        color: #D7A865;
                    }
                }

                &.item_gz {
                    .item_status {
                        background: #FF8100;
                    }
                    .item_num {
                        color:#FF8100;
                    }
                }

                &.item_lx {
                    .item_status {
                        background: #FF3232;
                    }
                    .item_num {
                        color:#FF3232;
                    }
                }
            }
        }
    }
}
</style>
